home *** CD-ROM | disk | FTP | other *** search
- Path: user1.mnsinc.com!huang
- From: huang@mnsinc.com (Szu-Wen Huang)
- Newsgroups: comp.lang.c++,comp.lang.c,comp.os.ms-windows.programmer.misc
- Subject: Re: fastest code
- Followup-To: comp.lang.c++,comp.lang.c,comp.os.ms-windows.programmer.misc
- Date: 10 Apr 1996 14:50:47 GMT
- Organization: Monumental Network Systems
- Message-ID: <4kghs7$250@news1.mnsinc.com>
- References: <316112A2.7D37@public.sta.net.cn> <4k4ll5$fq@solutions.solon.com> <4ke5v6$17k@samba.rahul.net> <1996Apr10.110121.6784@friend.kastle.com> <4kgbmj$j3j@solutions.solon.com>
- NNTP-Posting-Host: user.mnsinc.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Peter Seebach (seebs@solutions.solon.com) wrote:
- : In article <1996Apr10.110121.6784@friend.kastle.com>,
- : Richard Krehbiel <rich@kastle.com> wrote:
- : >Oliver Hellwig <hellwig@rahul.net> wrote:
- : >> for (i=0; i<16; i++)
- : >> prom[i] = prom[i+i];
-
- : >>The output of the compiler left the loop but removed the
- : >>assignment!
-
- : >I suspect a proper "volatile" declaration on "prom" might have fixed
- : >this, i.e. if "prom" is currently declared "char prom[16]" then it
- : >should be declared "volatile char prom[16]". I would not consider
- : >this an optimizer bug in Watcom.
-
- : HUH? the code as written has a clear effect, which is to shove all of
- : the elements of an array over one. It certainly is an optimizer bug.
-
- : Read the code carefully; the 2nd reference to prom[] uses a different
- : index into the array. This is not a meaningless statement.
-
- *You* read closely. The second index is "i+i". ;) Okay, so it's a
- typo, but one who says "read carefully" is expected to. Cheers.
-